package com.disthen.message.core.util;

import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.FanoutExchange;
import org.springframework.amqp.core.TopicExchange;

public class NamespaceUtils {

	public static Class<?>  getExchange(String type){
		switch (type) {
			case "topic":
				return TopicExchange.class;
			case "public":
				return FanoutExchange.class;
			case "direct":
				return DirectExchange.class;
			default:
				return TopicExchange.class;
		}
	}
	
	public static boolean isNeedRoutingKey(String type){
		if(type == "public")
			return false;
		else return true;
	}
}
